import { makeAutoObservable, action } from 'mobx';

class BalanceStore {
    balance: string = '0.00';

    applyNum: string = '';

    alertTip: string = '';

    alertStatus: boolean = false;

    setAlertTip(alertTip: string) {
        this.alertTip = alertTip;
    }

    setAlertStatus(alertStatus: boolean) {
        this.alertStatus = alertStatus;
        if (!alertStatus) {
            this.alertTip = '';
        }
    }

    constructor() {
        makeAutoObservable(this, {
            handleSumit: action.bound,
        });
    }

    setApplyNum(applyNum: string) {
        this.applyNum = applyNum;
    }

    handleSumit() {
        if (!this.applyNum) {
            this.alertTip = '请输入金额';
            this.alertStatus = true;
        }
    }
}

export default new BalanceStore();
